package com.chen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chen.pojo.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageMapper extends BaseMapper<Message> {

    @Select("SELECT DATE_FORMAT(time, '%Y-%m-%d' ) AS time, COUNT(*) AS total FROM message GROUP BY DATE_FORMAT(time, '%Y-%m-%d') ORDER BY time \n")
    List<Message> findCommit();
}
